package com.gzy.cbrsystem.insomnia;

import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.LockMode;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

/**
 * A data access object (DAO) providing persistence and search support for
 * DiagnosisBit entities. Transaction control of the save(), update() and
 * delete() operations can directly support Spring container-managed
 * transactions or they can be augmented to handle user-managed Spring
 * transactions. Each of these methods provides additional information for how
 * to configure it for the desired type of transaction control.
 * 
 * @see com.gzy.cbrsystem.insomnia.DiagnosisBit
 * @author MyEclipse Persistence Tools
 */

public class DiagnosisBitDAO extends HibernateDaoSupport {
	private static final Log log = LogFactory.getLog(DiagnosisBitDAO.class);
	// property constants
	public static final String XYBB1 = "xybb1";
	public static final String XYBB2 = "xybb2";
	public static final String XYBB3 = "xybb3";
	public static final String CHENGDU1 = "chengdu1";
	public static final String CHENGDU2 = "chengdu2";
	public static final String CHENGDU3 = "chengdu3";
	public static final String BINGCHENG1 = "bingcheng1";
	public static final String BINGCHENG2 = "bingcheng2";
	public static final String BINGCHENG3 = "bingcheng3";
	public static final String LEIXING1 = "leixing1";
	public static final String LEIXING2 = "leixing2";
	public static final String LEIXING3 = "leixing3";
	public static final String LEIXING4 = "leixing4";
	public static final String LEIXING5 = "leixing5";
	public static final String LEIXING6 = "leixing6";
	public static final String ZYBB1 = "zybb1";
	public static final String ZYBB2 = "zybb2";
	public static final String ZYBB3 = "zybb3";
	public static final String YZM = "yzm";
	public static final String MW = "mw";
	public static final String LY = "ly";
	public static final String WDW1 = "wdw1";
	public static final String WDW2 = "wdw2";
	public static final String LYR1 = "lyr1";
	public static final String LYR2 = "lyr2";
	public static final String FWB = "fwb";
	public static final String CQX = "cqx";
	public static final String LBQ = "lbq";
	public static final String CXH = "cxh";
	public static final String FL = "fl";
	public static final String QT = "qt";
	public static final String BGBZ = "bgbz";
	public static final String BGBZ1 = "bgbz1";
	public static final String YYDLL = "yydll";
	public static final String YYDLL1 = "yydll1";
	public static final String YYDLL11 = "yydll11";
	public static final String YYDLL12 = "yydll12";
	public static final String YYDLL2 = "yydll2";
	public static final String YYDLL21 = "yydll21";
	public static final String YYDLL22 = "yydll22";
	public static final String YYDLL23 = "yydll23";
	public static final String YYDLL3 = "yydll3";
	public static final String YYDLL31 = "yydll31";
	public static final String YYDLL32 = "yydll32";
	public static final String LJBZ = "ljbz";
	public static final String LJBZ1 = "ljbz1";
	public static final String LJBZ2 = "ljbz2";
	public static final String LJBZ3 = "ljbz3";
	public static final String LJBZ4 = "ljbz4";
	public static final String TZBZ = "tzbz";
	public static final String TZBZ1 = "tzbz1";
	public static final String TZBZ2 = "tzbz2";
	public static final String TZBZ3 = "tzbz3";
	public static final String TZBZ4 = "tzbz4";
	public static final String TZBZ5 = "tzbz5";
	public static final String TZBZ6 = "tzbz6";
	public static final String TZBZ7 = "tzbz7";
	public static final String GFBZ = "gfbz";
	public static final String GFBZ1 = "gfbz1";
	public static final String GFBZ2 = "gfbz2";
	public static final String GFBZ3 = "gfbz3";
	public static final String GFBZ4 = "gfbz4";
	public static final String GFBZ5 = "gfbz5";
	public static final String GFBZ6 = "gfbz6";
	public static final String GFBZ7 = "gfbz7";
	public static final String GFBZ8 = "gfbz8";
	public static final String GFBZ9 = "gfbz9";
	public static final String GFBZ10 = "gfbz10";
	public static final String JLBZ = "jlbz";
	public static final String JLBZ1 = "jlbz1";
	public static final String JLBZ2 = "jlbz2";
	public static final String JLBZ3 = "jlbz3";
	public static final String JLBZ4 = "jlbz4";
	public static final String JLBZ5 = "jlbz5";
	public static final String JLBZ6 = "jlbz6";
	public static final String JLBZ7 = "jlbz7";
	public static final String JLBZ8 = "jlbz8";
	public static final String JLBZ9 = "jlbz9";
	public static final String JLBZ10 = "jlbz10";
	public static final String JLBZ11 = "jlbz11";
	public static final String JLBZ12 = "jlbz12";
	public static final String JLBZ13 = "jlbz13";
	public static final String JLBZ14 = "jlbz14";

	protected void initDao() {
		// do nothing
	}

	public void save(DiagnosisBit transientInstance) {
		log.debug("saving DiagnosisBit instance");
		try {
			getHibernateTemplate().save(transientInstance);
			log.debug("save successful");
		} catch (RuntimeException re) {
			log.error("save failed", re);
			throw re;
		}
	}

	public void delete(DiagnosisBit persistentInstance) {
		log.debug("deleting DiagnosisBit instance");
		try {
			getHibernateTemplate().delete(persistentInstance);
			log.debug("delete successful");
		} catch (RuntimeException re) {
			log.error("delete failed", re);
			throw re;
		}
	}

	public DiagnosisBit findById(java.lang.String id) {
		log.debug("getting DiagnosisBit instance with id: " + id);
		try {
			DiagnosisBit instance = (DiagnosisBit) getHibernateTemplate().get(
					"com.gzy.cbrsystem.insomnia.DiagnosisBit", id);
			return instance;
		} catch (RuntimeException re) {
			log.error("get failed", re);
			throw re;
		}
	}

	public List findByExample(DiagnosisBit instance) {
		log.debug("finding DiagnosisBit instance by example");
		try {
			List results = getHibernateTemplate().findByExample(instance);
			log.debug("find by example successful, result size: "
					+ results.size());
			return results;
		} catch (RuntimeException re) {
			log.error("find by example failed", re);
			throw re;
		}
	}

	public List findByProperty(String propertyName, Object value) {
		log.debug("finding DiagnosisBit instance with property: "
				+ propertyName + ", value: " + value);
		try {
			String queryString = "from DiagnosisBit as model where model."
					+ propertyName + "= ?";
			return getHibernateTemplate().find(queryString, value);
		} catch (RuntimeException re) {
			log.error("find by property name failed", re);
			throw re;
		}
	}

	public List findByXybb1(Object xybb1) {
		return findByProperty(XYBB1, xybb1);
	}

	public List findByXybb2(Object xybb2) {
		return findByProperty(XYBB2, xybb2);
	}

	public List findByXybb3(Object xybb3) {
		return findByProperty(XYBB3, xybb3);
	}

	public List findByChengdu1(Object chengdu1) {
		return findByProperty(CHENGDU1, chengdu1);
	}

	public List findByChengdu2(Object chengdu2) {
		return findByProperty(CHENGDU2, chengdu2);
	}

	public List findByChengdu3(Object chengdu3) {
		return findByProperty(CHENGDU3, chengdu3);
	}

	public List findByBingcheng1(Object bingcheng1) {
		return findByProperty(BINGCHENG1, bingcheng1);
	}

	public List findByBingcheng2(Object bingcheng2) {
		return findByProperty(BINGCHENG2, bingcheng2);
	}

	public List findByBingcheng3(Object bingcheng3) {
		return findByProperty(BINGCHENG3, bingcheng3);
	}

	public List findByLeixing1(Object leixing1) {
		return findByProperty(LEIXING1, leixing1);
	}

	public List findByLeixing2(Object leixing2) {
		return findByProperty(LEIXING2, leixing2);
	}

	public List findByLeixing3(Object leixing3) {
		return findByProperty(LEIXING3, leixing3);
	}

	public List findByLeixing4(Object leixing4) {
		return findByProperty(LEIXING4, leixing4);
	}

	public List findByLeixing5(Object leixing5) {
		return findByProperty(LEIXING5, leixing5);
	}

	public List findByLeixing6(Object leixing6) {
		return findByProperty(LEIXING6, leixing6);
	}

	public List findByZybb1(Object zybb1) {
		return findByProperty(ZYBB1, zybb1);
	}

	public List findByZybb2(Object zybb2) {
		return findByProperty(ZYBB2, zybb2);
	}

	public List findByZybb3(Object zybb3) {
		return findByProperty(ZYBB3, zybb3);
	}

	public List findByYzm(Object yzm) {
		return findByProperty(YZM, yzm);
	}

	public List findByMw(Object mw) {
		return findByProperty(MW, mw);
	}

	public List findByLy(Object ly) {
		return findByProperty(LY, ly);
	}

	public List findByWdw1(Object wdw1) {
		return findByProperty(WDW1, wdw1);
	}

	public List findByWdw2(Object wdw2) {
		return findByProperty(WDW2, wdw2);
	}

	public List findByLyr1(Object lyr1) {
		return findByProperty(LYR1, lyr1);
	}

	public List findByLyr2(Object lyr2) {
		return findByProperty(LYR2, lyr2);
	}

	public List findByFwb(Object fwb) {
		return findByProperty(FWB, fwb);
	}

	public List findByCqx(Object cqx) {
		return findByProperty(CQX, cqx);
	}

	public List findByLbq(Object lbq) {
		return findByProperty(LBQ, lbq);
	}

	public List findByCxh(Object cxh) {
		return findByProperty(CXH, cxh);
	}

	public List findByFl(Object fl) {
		return findByProperty(FL, fl);
	}

	public List findByQt(Object qt) {
		return findByProperty(QT, qt);
	}

	public List findByBgbz(Object bgbz) {
		return findByProperty(BGBZ, bgbz);
	}

	public List findByBgbz1(Object bgbz1) {
		return findByProperty(BGBZ1, bgbz1);
	}

	public List findByYydll(Object yydll) {
		return findByProperty(YYDLL, yydll);
	}

	public List findByYydll1(Object yydll1) {
		return findByProperty(YYDLL1, yydll1);
	}

	public List findByYydll11(Object yydll11) {
		return findByProperty(YYDLL11, yydll11);
	}

	public List findByYydll12(Object yydll12) {
		return findByProperty(YYDLL12, yydll12);
	}

	public List findByYydll2(Object yydll2) {
		return findByProperty(YYDLL2, yydll2);
	}

	public List findByYydll21(Object yydll21) {
		return findByProperty(YYDLL21, yydll21);
	}

	public List findByYydll22(Object yydll22) {
		return findByProperty(YYDLL22, yydll22);
	}

	public List findByYydll23(Object yydll23) {
		return findByProperty(YYDLL23, yydll23);
	}

	public List findByYydll3(Object yydll3) {
		return findByProperty(YYDLL3, yydll3);
	}

	public List findByYydll31(Object yydll31) {
		return findByProperty(YYDLL31, yydll31);
	}

	public List findByYydll32(Object yydll32) {
		return findByProperty(YYDLL32, yydll32);
	}

	public List findByLjbz(Object ljbz) {
		return findByProperty(LJBZ, ljbz);
	}

	public List findByLjbz1(Object ljbz1) {
		return findByProperty(LJBZ1, ljbz1);
	}

	public List findByLjbz2(Object ljbz2) {
		return findByProperty(LJBZ2, ljbz2);
	}

	public List findByLjbz3(Object ljbz3) {
		return findByProperty(LJBZ3, ljbz3);
	}

	public List findByLjbz4(Object ljbz4) {
		return findByProperty(LJBZ4, ljbz4);
	}

	public List findByTzbz(Object tzbz) {
		return findByProperty(TZBZ, tzbz);
	}

	public List findByTzbz1(Object tzbz1) {
		return findByProperty(TZBZ1, tzbz1);
	}

	public List findByTzbz2(Object tzbz2) {
		return findByProperty(TZBZ2, tzbz2);
	}

	public List findByTzbz3(Object tzbz3) {
		return findByProperty(TZBZ3, tzbz3);
	}

	public List findByTzbz4(Object tzbz4) {
		return findByProperty(TZBZ4, tzbz4);
	}

	public List findByTzbz5(Object tzbz5) {
		return findByProperty(TZBZ5, tzbz5);
	}

	public List findByTzbz6(Object tzbz6) {
		return findByProperty(TZBZ6, tzbz6);
	}

	public List findByTzbz7(Object tzbz7) {
		return findByProperty(TZBZ7, tzbz7);
	}

	public List findByGfbz(Object gfbz) {
		return findByProperty(GFBZ, gfbz);
	}

	public List findByGfbz1(Object gfbz1) {
		return findByProperty(GFBZ1, gfbz1);
	}

	public List findByGfbz2(Object gfbz2) {
		return findByProperty(GFBZ2, gfbz2);
	}

	public List findByGfbz3(Object gfbz3) {
		return findByProperty(GFBZ3, gfbz3);
	}

	public List findByGfbz4(Object gfbz4) {
		return findByProperty(GFBZ4, gfbz4);
	}

	public List findByGfbz5(Object gfbz5) {
		return findByProperty(GFBZ5, gfbz5);
	}

	public List findByGfbz6(Object gfbz6) {
		return findByProperty(GFBZ6, gfbz6);
	}

	public List findByGfbz7(Object gfbz7) {
		return findByProperty(GFBZ7, gfbz7);
	}

	public List findByGfbz8(Object gfbz8) {
		return findByProperty(GFBZ8, gfbz8);
	}

	public List findByGfbz9(Object gfbz9) {
		return findByProperty(GFBZ9, gfbz9);
	}

	public List findByGfbz10(Object gfbz10) {
		return findByProperty(GFBZ10, gfbz10);
	}

	public List findByJlbz(Object jlbz) {
		return findByProperty(JLBZ, jlbz);
	}

	public List findByJlbz1(Object jlbz1) {
		return findByProperty(JLBZ1, jlbz1);
	}

	public List findByJlbz2(Object jlbz2) {
		return findByProperty(JLBZ2, jlbz2);
	}

	public List findByJlbz3(Object jlbz3) {
		return findByProperty(JLBZ3, jlbz3);
	}

	public List findByJlbz4(Object jlbz4) {
		return findByProperty(JLBZ4, jlbz4);
	}

	public List findByJlbz5(Object jlbz5) {
		return findByProperty(JLBZ5, jlbz5);
	}

	public List findByJlbz6(Object jlbz6) {
		return findByProperty(JLBZ6, jlbz6);
	}

	public List findByJlbz7(Object jlbz7) {
		return findByProperty(JLBZ7, jlbz7);
	}

	public List findByJlbz8(Object jlbz8) {
		return findByProperty(JLBZ8, jlbz8);
	}

	public List findByJlbz9(Object jlbz9) {
		return findByProperty(JLBZ9, jlbz9);
	}

	public List findByJlbz10(Object jlbz10) {
		return findByProperty(JLBZ10, jlbz10);
	}

	public List findByJlbz11(Object jlbz11) {
		return findByProperty(JLBZ11, jlbz11);
	}

	public List findByJlbz12(Object jlbz12) {
		return findByProperty(JLBZ12, jlbz12);
	}

	public List findByJlbz13(Object jlbz13) {
		return findByProperty(JLBZ13, jlbz13);
	}

	public List findByJlbz14(Object jlbz14) {
		return findByProperty(JLBZ14, jlbz14);
	}

	public List findAll() {
		log.debug("finding all DiagnosisBit instances");
		try {
			String queryString = "from DiagnosisBit";
			return getHibernateTemplate().find(queryString);
		} catch (RuntimeException re) {
			log.error("find all failed", re);
			throw re;
		}
	}

	public DiagnosisBit merge(DiagnosisBit detachedInstance) {
		log.debug("merging DiagnosisBit instance");
		try {
			DiagnosisBit result = (DiagnosisBit) getHibernateTemplate().merge(
					detachedInstance);
			log.debug("merge successful");
			return result;
		} catch (RuntimeException re) {
			log.error("merge failed", re);
			throw re;
		}
	}

	public void attachDirty(DiagnosisBit instance) {
		log.debug("attaching dirty DiagnosisBit instance");
		try {
			getHibernateTemplate().saveOrUpdate(instance);
			log.debug("attach successful");
		} catch (RuntimeException re) {
			log.error("attach failed", re);
			throw re;
		}
	}

	public void attachClean(DiagnosisBit instance) {
		log.debug("attaching clean DiagnosisBit instance");
		try {
			getHibernateTemplate().lock(instance, LockMode.NONE);
			log.debug("attach successful");
		} catch (RuntimeException re) {
			log.error("attach failed", re);
			throw re;
		}
	}

	public static DiagnosisBitDAO getFromApplicationContext(
			ApplicationContext ctx) {
		return (DiagnosisBitDAO) ctx.getBean("DiagnosisBitDAO");
	}
}